%% Author: gnibre
%% Created: Jul 10, 2009
%% Description: TODO: Add description to ifriendout
-module(ifriendout).

%%
%% Include files
%%
-include("../../include/header.hrl").
%%
%% Exported Functions
%%
-export([out/0]).

%%
%% API Functions
%%

out()->
%%	check otp server
%% 	check_otp_server(),
	net_adm:ping(iserver@gnibreD),
	case global:registered_names() of
		[]->
			error_logger:error_msg("Server can't be reached currently!");
		NameList->
			continue
	end,
	io:format("NameLIst : ~p~n",[NameList]).


%% frame.o.m 
out2()->
	-include_lib("../../lib/header.hrl"),
	case  gen_server:call({global,ifriend_server},{queryFrame,1}) of
		[]-> %%freshman
			"Newcomer of ifriend here! My dear firends, where are you ?";
		[FS]->
			{F,Fid} = FS,
			F
	end.


			
	
			
			
	

%%
%% Local Functions
%%
check_otp_server()->
	net_adm:ping(iserver@gnibreD),
	case global:registered_names() of
		[]->
			error_logger:error_msg("Server can't be reached currently!"),
			[];
		NameList->
			NameList
	end.
